Teacher Version

Hero Image
Hero Image

Forward Until Red

Topics Covered

  • Color Sensor
  • Forward Until Red
 

Virtual Robot: MoveUntilColorVR.rbg

Physical Robot: MoveUntilColor.rbg

Check Your Understanding

  1. What does this program do when run?
    1. Move forward when the Color Sensor sees a red object
    2. Move forward until the Color Sensor sees a red object
    3. Move forward until the Color Sensor sees a green object
    4. Move forward as long as nothing is in the robot's way
  2. What would happen if the red cube was replaced with a green cube and the same program was run?
    1. The robot would still stop when it came to the green cube.
    2. The robot would keep going since the condition for the robot stopping was the color sensor detecting the color red.
    3. The robot would not move since it is waiting for the color sensor to detect the color red before it starts moving.
    4. The robot would begin moving backwards because that is what it was programmed to do when it saw the color green.

ClosedClick here for the Answers

B. Move forward until the Color Sensor sees a red object

B. The robot would keep going since the condition for the robot stopping was the color sensor detecting the color red

© 2016 Robomatter, Inc.

Portions of this product are manufactured under license from Carnegie Mellon University.